package cn.z2huo.knowledge.basic.bit.shiftoperation;

/**
 * <p>
 *
 * @author z2huo
 */
class BitMoveOperateTest {

    public static void main(String[] args) {
        int a = 0b0011_1100;

        System.out.println(a);
        System.out.println(a << 2);
        System.out.println(a >>> 2);

        int b = 0b0000_1101;
        System.out.println();
        System.out.println(b);
        System.out.println(b << 1);
        System.out.println(b >>> 1);
        System.out.println(b >> 1);

        int c = -0b0000_1101;
        System.out.println();
        System.out.println(c);
        System.out.println(Integer.toBinaryString(c));
        System.out.println(c >> 1);
        System.out.println(Integer.toBinaryString(c >> 1));

        System.out.println();
        test();
    }

    static void test() {
        System.out.println();
        int a = 1, b = 2, c = 3;
        String s = "hhh";
        System.out.println(a + b + c + s);
        System.out.println(s + a + b + c);
    }
}